const express = require('express');
const router = express.Router();
const infoService = require('../service/user/infoService');
const infoManageService = require('../service/admin/infoManageService');
const {verifyToken, verifyAdminToken} = require('../middleware/auth')

router.post('/getColleges', verifyToken, infoService.getColleges)
router.post('/getSports', verifyToken, infoService.getSports)
router.put('/feedback/put', verifyToken, infoService.putFeedback)

/**
 * 管理员端入口
 */
router.post('/admin/getColleges', verifyAdminToken, infoService.getColleges)
router.post('/admin/addCollege', verifyAdminToken, infoManageService.addCollege)
router.post('/admin/deleteCollege', verifyAdminToken, infoManageService.deleteCollege)

router.post('/admin/getSports', verifyAdminToken, infoService.getSports)
router.post('/admin/addSport', verifyAdminToken, infoManageService.addSport)
router.post('/admin/deleteSport', verifyAdminToken, infoManageService.deleteSport)

router.post('/admin/feedback/get', verifyAdminToken, infoManageService.getFeedback)
router.post('/admin/feedback/delete', verifyAdminToken, infoManageService.deleteFeedback)


module.exports = router;
